<?php

namespace App\Enums;

use App\Traits\EnumTrait;

/**
 * 小程序菜单板块枚举
 * @method static string getName($value)
 * Class AppMiniPlateEnum
 */
class AppMiniPlateEnum extends \PhpEnum\PhpEnum
{
    use EnumTrait;

    private static $PLATE_LIST_NAME = [
        'hot_search'=>'搜索热词',
        'top_recommend'=>'顶部推荐',
        'position'=>'金刚位置',
        'waist_recommend'=>'腰封推荐',

        'great_category'=>'超值分类',
        'great'=>'超值爆品',

        'active_banner'=>'活动轮播',
        'fans'=>'粉丝入群',
        'active_recommend'=>'活动推荐',
        'goods_recommend'=>'推荐商品',

        'category_config'=>'分类配置',
        'category_recommend'=>'分类推荐',
        'category_recommend_brand'=>'分类推荐品牌',
        'category_goods'=>'分类商品',

        'care_words'=>'严选热词',
        'super_cost'=>'超级划算',
        'care_recommend'=>'严选腰封推荐',
        'care_goods'=>'严选商品',

        'for_you_recommend'=>'为你推荐',
        'guess_words'=>'猜你想搜',
        'week_hot_words'=>'本周热搜',
    ];
    private static $PLATE_LIST = ['hot_search','top_recommend','great_category','position','great','waist_recommend','active_banner','fans','active_recommend','goods_recommend',
        'category_config','category_recommend','category_recommend_brand','category_goods','care_words','super_cost','care_recommend','care_goods','for_you_recommend','guess_words','week_hot_words'];

    private static $PLATE_LIST_GROUP = [
                                'hot_search'=>'home_field',
                                'top_recommend'=>'home_field',
                                'position'=>'home_field',
                                'waist_recommend'=>'home_field',

                                'great_category'=>'great',
                                'great'=>'great',

                                'active_banner'=>'home_active',
                                'fans'=>'home_active',
                                'active_recommend'=>'home_active',
                                'goods_recommend'=>'home_active',

                                'category_config'=>'category',
                                'category_recommend'=>'category',
                                'category_recommend_brand'=>'category',
                                'category_goods'=>'category',

                                'care_words'=>'care',
                                'super_cost'=>'care',
                                'care_recommend'=>'care',
                                'care_goods'=>'care',

                                'for_you_recommend'=>'recommend',

                                'guess_words'=>'search_manage',
                                'week_hot_words'=>'search_manage',
                        ];
    public static function plateList()
    {
        return self::$PLATE_LIST;
    }
    public static function plateListName()
    {
        return self::$PLATE_LIST_NAME;
    }

    public static function getPlateName($value)
    {
        return self::$PLATE_LIST_NAME[$value];
    }

    public static function getPlateGroup($value)
    {
        return self::$PLATE_LIST_GROUP[$value];
    }

    public static function plateIsValid($value)
    {
        return in_array($value,self::$PLATE_LIST);
    }

}
